<%--
  Created by IntelliJ IDEA.
  User: LeiPeichen
  Date: 4/17/15
  Time: 11:45 AM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>手机端登陆</title>

  <script src="../../static/assets/js/jquery.min.js"></script>
  <script type="application/javascript">
    function collect(){
      var formData = {region:$("#region").val(),name:$("#name").val()};
      $.ajax({
        url:"/api/v1/addresses",
        type:"post",
        contentType:"application/json",
        data:JSON.stringify(formData),
        dataType:"jsonp",
        success: function(result){
        }
      });
    }
  </script>
</head>
<body>

<form:form method="POST" action="api/v1/addresses">
  <table>
    <tr>
      <td>region：</td>
      <td>
        <input type="text" id="region" name="region" value=""/>
      </td>
    </tr>
    <tr>
      <td>name：</td>
      <td><input type="text" id="name" name="name" value=""/></td>
    </tr>
    <tr>
      <td colspan="2"><a href="javascript:void(0);" onclick="collect();">收藏此地址</a></td>
    </tr>
  </table>
</form:form>

</body>
</html>
